package org.lionsoul.websnail.downloader;

/**
 * 代理对象
 *
 * @author yangjian
 **/
public class Proxy {
	public static final String HTTP = "http";
	public static final String HTTPS = "https";
	public static final String SOCKS5 = "socks5";

	// 代理协议 http, https, socks5
	private String protocol;
	// 代理主机
	private String host;
	// 代理端口
	private int port;

	public Proxy(String protocol, String host, int port)
	{
		this.protocol = protocol;
		this.host = host;
		this.port = port;
	}

	public static Proxy getHttpProxy(String host, int port)
	{
		return new Proxy(HTTP, host, port);
	}

	public static Proxy getHttpsProxy(String host, int port)
	{
		return new Proxy(HTTPS, host, port);
	}

	public static Proxy getSocksProxy(String host, int port)
	{
		return new Proxy(SOCKS5, host, port);
	}

	public String getProtocol()
	{
		return protocol;
	}

	public void setProtocol(String protocol)
	{
		this.protocol = protocol;
	}

	public String getHost()
	{
		return host;
	}

	public void setHost(String host)
	{
		this.host = host;
	}

	public int getPort()
	{
		return port;
	}

	public void setPort(int port)
	{
		this.port = port;
	}

}
